<!doctype html public "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<html>
<head>
<title>
 Overview
</title>
<link rel ="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script>
function asd() {
	
		parent.document.title="taconite-client.js Overview";
	
}
</script>
</head>
<body bgcolor="white" onload="asd();">

<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> 	<font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top">
<em>
<b></b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<center>
	
	   <h2>taconite-client.js</h2>
	
</center>

	


<h4>Summary</h4>
<p>
	
		This JavaScript file represents the core browser-side functionality
 supplied by Taconite. In general, the tools in this file wrap an instance
 of XMLHttpRequest object and provide utility methods for gather data from
 form elements to be sent to the server as par of an Ajax request.<BR/><BR/>
	
</p>

<hr>


    <table border="1" cellpadding="3" cellspacing="0" width="100%">
    <tr bgcolor="#CCCCFF" class="TableHeadingColor">
    <td colspan=2><font size="+2">
    
        <b>Class Summary</b>
    
    </font></td>
    </tr>
    
    <tr bgcolor="white" class="TableRowColor">
    <td width="15%"><b><a href="AjaxRequest.html">AjaxRequest</a></b></td>
    <td>The AjaxRequest object wraps an instance of XMLHttpRequest and provides 
 facilities for setting functions that are called before a request is made
 and after a request returns.</td>
    </tr>
    
    </table>
    <hr/> 


<!-- ========== METHOD SUMMARY =========== -->

<!-- ========== END METHOD SUMMARY =========== -->


        <pre class="sourceview"><span class="comment">/**
 <span class="attrib">@fileoverview</span>
 
 This JavaScript file represents the core browser-side functionality
 supplied by Taconite. In general, the tools in this file wrap an instance
 of XMLHttpRequest object and provide utility methods for gather data from
 form elements to be sent to the server as par of an Ajax request.
 */</span>

var taconite_client_version=<span class="literal">"3.0"</span>;

<span class="comment">/**
 Constructor for the AjaxRequest class. 
 
 &lt;br&gt;&lt;br&gt;
 Example:
 
 &lt;br&gt;&lt;br&gt;
 var ajaxRequest = new AjaxRequest("YOUR_URL");
 
 <span class="attrib">@class</span> The AjaxRequest object wraps an instance of XMLHttpRequest and provides 
 facilities for setting functions that are called before a request is made
 and after a request returns. By default, AjaxRequest handles the server
 response by simply calling eval(), passing to it the responseText from 
 the XMLHttpRequestObject, of course assuming that the response was 
 generated by Taconite on the server side and that running eval() will 
 update the web page.&lt;br&gt;&lt;br&gt;Example Usage:&lt;br&gt;&lt;br&gt;var ajaxRequest = new AjaxRequest("YOUR_URL");
 &lt;br&gt;ajaxRequest.addFormElements("form_element_id_attribute_value-or-form_dom_element");
 &lt;br&gt;ajaxRequest.sendRequest();
 
 <span class="attrib">@constructor</span>
 <span class="attrib">@param</span> {String} a String repesenting the URL to which the Ajax request
 will be sent.
 */</span>
<span class="reserved">function</span> AjaxRequest(url) {
    <span class="comment">/** <span class="attrib">@private</span> */</span>
    var self = <span class="reserved">this</span>;
    
    <span class="comment">/** <span class="attrib">@private</span> */</span>
    var xmlHttp = createXMLHttpRequest();
    
    <span class="comment">/** <span class="attrib">@private</span> */</span>
    var queryString = <span class="literal">""</span>;
    
    <span class="comment">/** <span class="attrib">@private</span> */</span>
    var requestURL = url;
    
    <span class="comment">/** <span class="attrib">@private</span> */</span>
    var method = <span class="literal">"GET"</span>;
    
    <span class="comment">/** <span class="attrib">@private</span> */</span>
    var preRequest = null;
    
    <span class="comment">/** <span class="attrib">@private</span> */</span>
    var postRequest = null;
    
    <span class="comment">/** <span class="attrib">@private</span> */</span>
    var debugResponse = false;
    
    <span class="comment">/** <span class="attrib">@private</span> */</span>
    var async = true;
    
    <span class="comment">/** <span class="attrib">@private</span> */</span>
    var parser = new TaconiteParser();
    
    <span class="comment">/** <span class="attrib">@private</span> errorHandler*/</span> 
    var errorHandler = null;
    
    
    <span class="comment">/**
     Return the instance of the XMLHttpRequest object wrapped by this object.
     <span class="attrib">@return</span> XMLHttpRequest
     */</span>
    <span class="reserved">this</span>.getXMLHttpRequestObject = <span class="reserved">function</span>() {
        <span class="reserved">return</span> xmlHttp;
    }

    <span class="comment">/**
     Return the parser that wil be used to parse the reponse to this request.
    */</span>
    <span class="reserved">this</span>.getParser = <span class="reserved">function</span>() {
        <span class="reserved">return</span> parser;
    }
    
    <span class="comment">/** 
     <span class="attrib">@param</span> {Parser} Set the parser that's used to parse the server's XML response,
     Deaults to the standard TaconiteParser class.
     */</span>	
    <span class="reserved">this</span>.setParser = <span class="reserved">function</span>(newParser) {
        parser = newParser;
    }
    
    <span class="comment">/**
     Set the pre-request function. This function will be called prior to 
     sending the Ajax request. The pre-request function is passed a reference
     to this AjaxRequest object.
     <span class="attrib">@param</span> {Function} The function to be called prior to sending the Ajax
     request. The function has passed to it this AjaxRequest object.
     */</span>
    <span class="reserved">this</span>.setPreRequest = <span class="reserved">function</span>(func) {
        preRequest = func;
    }
    
    <span class="comment">/**
     Add a function to the list of pre request functions that will be called 
     before the request is sent to the server.  The pre request function has passed
     to it this AjaxRequest object.  This method is similar to setPreRequest, 
     except that method overwrites the previously existing pre request method,
     while this one adds a function to the list of functions.  Pre request functions
     are called in the order in which they were added.
     <span class="attrib">@param</span> {Function} A function to be called prior to sending the Ajax
     request. The function has passed to it this AjaxRequest object.
    */</span>
    <span class="reserved">this</span>.addPreRequest = <span class="reserved">function</span>(func) {
        var previous = preRequest;
        preRequest = <span class="reserved">function</span>() {
            <span class="reserved">if</span>(previous != null) {
                previous();
            }
            func();
        };
    }

    <span class="comment">/**
     Set the post-request function. This function will be called after the
     response has been received and after the response XML has been parsed. 
     The post request function is passed a reference to this AjaxRequest object. 
     <span class="attrib">@param</span> {Function} The function to be called after receiving the Ajax
     response. The function is passed a reference of this AjaxRequest object.
     */</span>
    <span class="reserved">this</span>.setPostRequest = <span class="reserved">function</span>(func) {
        postRequest = func;
    }
    
    <span class="comment">/**
     Add a function to the list of post request functions.  The post request
     functions are called in the order in which they were added.  This method is
     similar to setPostRequest, except that method overwrites any previous post
     request method.  This one adds to the list of functions that are called after
     the response has been received.
     <span class="attrib">@param</span> {Function} A function to be called after receiving the Ajax
     response. The function is passed a reference of this AjaxRequest object.
    */</span>
    <span class="reserved">this</span>.addPostRequest = <span class="reserved">function</span>(func) {
        var previous = postRequest;
        postRequest = <span class="reserved">function</span>() {
            <span class="reserved">if</span>(previous != null) {
                previous();
            }
            func();
        };
    }
    
    <span class="comment">/**
     Return the post request function.
     */</span>
    <span class="reserved">this</span>.getPostRequest = <span class="reserved">function</span>() {
        <span class="reserved">return</span> postRequest;
    }
    
    <span class="comment">/**
     Send the Ajax request using the POST method. Use with caution -- some
     browsers do not support the POST method with the XMLHttpRequest object.
     */</span>
    <span class="reserved">this</span>.setUsePOST = <span class="reserved">function</span>() {
        method = <span class="literal">"POST"</span>;
    }
    
    <span class="comment">/**
     Send the Ajax request using the GET method, where parameters are sent
     as a query string appended to the URL. This is the default behavior.
     */</span>
    <span class="reserved">this</span>.setUseGET = <span class="reserved">function</span>() {
        method = <span class="literal">"GET"</span>;
    }
    
    <span class="comment">/**
     Enable client-side debugging.  The server's response will be written
     to a text area appended to the bottom of the page.  If parsing is
     performed on the client side, then the results of the parsing operations
     are shown in their own text areas.
     */</span>
    <span class="reserved">this</span>.setEchoDebugInfo = <span class="reserved">function</span>() {
        debugResponse = true;
    }
    
    <span class="comment">/**
     Indicate if debugging is enabled.
     <span class="attrib">@return</span> boolean
     */</span>
    <span class="reserved">this</span>.isEchoDebugInfo = <span class="reserved">function</span>() {
        <span class="reserved">return</span> debugResponse;
    }
    
    <span class="comment">/**
     Set the query string that will be sent to the server. For GET
     requests, the query string is appended to the URL. For POST
     requests, the query string is sent in the request body. This 
     method is useful, for example, if you want to send an XML string
     or JSON string to the server.
     <span class="attrib">@param</span> {String} qa, the new query string value.
     */</span>
    <span class="reserved">this</span>.setQueryString = <span class="reserved">function</span>(qs) {
        queryString = qs;
    }
    
    <span class="comment">/**
     Return the query string.
     <span class="attrib">@return</span> The query string.
     */</span>
    <span class="reserved">this</span>.getQueryString = <span class="reserved">function</span>() {
        <span class="reserved">return</span> queryString;
    }
    
    <span class="comment">/** 
     <span class="attrib">@param</span> {Boolean} asyncBoolean, set to true if asynchronous request, false synchronous request. 
     */</span>
    <span class="reserved">this</span>.setAsync = <span class="reserved">function</span>(asyncBoolean){
        async = asyncBoolean;
    }
    
    <span class="comment">/** 
     <span class="attrib">@param</span> {Function} Set the error handler function that is called if the 
     server's HTTP response code is something other than 200.
     */</span>	
    <span class="reserved">this</span>.setErrorHandler = <span class="reserved">function</span>(func){
        errorHandler = func;
    }
    
    <span class="comment">/**
     Add all of the form elements under the specified form to the query
     string to be sent to the server as part of the Ajax request. 
     The values are automatically encoded.
     <span class="attrib">@param</span> form, A form DOM element, or the id attribute of the form element from
     which you wish to accumulate the form values.
     */</span>
    <span class="reserved">this</span>.addFormElements = <span class="reserved">function</span>(form) {
        var formElements = new Array();
        <span class="reserved">if</span> (form != null) {
            <span class="reserved">if</span> (typeof form == <span class="literal">"string"</span>) {
                var el = document.getElementById(form);
                <span class="reserved">if</span> (el != null) {
                    formElements = el.elements;
                }
            } <span class="reserved">else</span> {
                formElements = form.elements;
            }
        }
        var values = toQueryString(formElements);
        accumulateQueryString(values);
    }
    
    <span class="comment">/**
     Add the name/value pair to the query string.
     <span class="attrib">@param</span> {String} name
     <span class="attrib">@param</span> {String} value
     */</span>
    <span class="reserved">this</span>.addNameValuePair = <span class="reserved">function</span>(name, value) {
        var nameValuePair = name + <span class="literal">"="</span> + encodeURIComponent(value);
        accumulateQueryString(nameValuePair);
    }
    
    <span class="comment">/**
     Same as addNamedFormElements, except it will filter form elements by form's id.
     For example, these are all valid uses:&lt;br&gt;
     &lt;br&gt;ajaxRequest.addNamedFormElements("form-id""element-name-1");
     &lt;br&gt;ajaxRequest.addNamedFormElements("form-id","element-name-1",
     "element-name-2", "element-name-3");
     */</span>
    <span class="reserved">this</span>.addNamedFormElementsByFormID = <span class="reserved">function</span>() {
        var elementName = <span class="literal">""</span>;
        var namedElements = null;
        
        <span class="reserved">for</span>(var i = 1; i &lt; arguments.length; i++) {
            elementName = arguments[i];
            namedElements = document.getElementsByName(elementName);
            var arNamedElements = new Array();
            <span class="reserved">for</span>(j = 0; j &lt; namedElements.length; j++) {
                <span class="reserved">if</span>(namedElements[j].form  &amp;&amp; namedElements[j].form.getAttribute(<span class="literal">"id"</span>) == arguments[0]){
                    arNamedElements.push(namedElements[j]);				
                }
            }
            <span class="reserved">if</span>(arNamedElements.length &gt; 0){
                elementValues = toQueryString(arNamedElements);
                accumulateQueryString(elementValues);
            }
        }
    }
    
    <span class="comment">/**
     Add the values of the named form elements to the query string to be
     sent to the server as part of the Ajax request. This method takes any 
     number of Strings representing the form elements for wish you wish to 
     accumulate the values. The Strings must be the value of the element's 
     name attribute.&lt;br&gt;&lt;br&gt;For example, these are all valid uses:&lt;br&gt;
     &lt;br&gt;ajaxRequest.addNamedFormElements("element-name-1");
     &lt;br&gt;ajaxRequest.addNamedFormElements("element-name-1", "element-name-2", "element-name-3");
     */</span>
    <span class="reserved">this</span>.addNamedFormElements = <span class="reserved">function</span>() {
        var elementName = <span class="literal">""</span>;
        var namedElements = null;
        
        <span class="reserved">for</span>(var i = 0; i &lt; arguments.length; i++) {
            elementName = arguments[i];
            namedElements = document.getElementsByName(elementName);
            
            elementValues = toQueryString(namedElements);
            
            accumulateQueryString(elementValues);
        }
        
    }
    
    <span class="comment">/**
     Add the values of the id'd form elements to the query string to be
     sent to the server as part of the Ajax request. This method takes any 
     number of Strings representing the ids of the form elements for wish you wish to 
     accumulate the values. The Strings must be the value of the element's 
     name attribute.&lt;br&gt;&lt;br&gt;For example, these are all valid uses:&lt;br&gt;
     &lt;br&gt;ajaxRequest.addFormElementsById("element-id-1");
     &lt;br&gt;ajaxRequest.addFormElementsById("element-id-1", "element-id-2", "element-id-3");
     */</span>
    <span class="reserved">this</span>.addFormElementsById = <span class="reserved">function</span>() {
        var id = <span class="literal">""</span>;
        var element = null;
        var elements = new Array();
        
        <span class="reserved">for</span>(var h = 0; h &lt; arguments.length; h++) {
            element = document.getElementById(arguments[h]);
            <span class="reserved">if</span>(element != null) {
                elements[h] = element;
            }
        }
        
        elementValues = toQueryString(elements);
        accumulateQueryString(elementValues);
    }
    
    <span class="comment">/**
     Send the Ajax request.
     */</span>
    <span class="reserved">this</span>.sendRequest = <span class="reserved">function</span>() {
        <span class="reserved">if</span>(preRequest) {
            preRequest(self);
        }
        
        var obj = <span class="reserved">this</span>;
        <span class="reserved">if</span>(async)
            xmlHttp.onreadystatechange = <span class="reserved">function</span> () { handleStateChange(self) };
            
            <span class="reserved">if</span>(requestURL.indexOf(<span class="literal">"?"</span>) &gt; 0) {
                requestURL = requestURL + <span class="literal">"&amp;ts="</span> + new Date().getTime();
            }
            <span class="reserved">else</span> {
                requestURL = requestURL + <span class="literal">"?ts="</span> + new Date().getTime();
            }
            
            
            try {
                <span class="reserved">if</span>(method == <span class="literal">"GET"</span>) {
                    <span class="reserved">if</span>(queryString.length &gt; 0) {
                        requestURL = requestURL + <span class="literal">"&amp;"</span> + queryString;
                    }
                    xmlHttp.open(method, requestURL, async);
                    xmlHttp.send(null);
                }
                <span class="reserved">else</span> {
                    xmlHttp.open(method, requestURL, async);
                    <span class="comment">//Fix a bug in Firefox when posting</span>
                    try {
                        <span class="reserved">if</span> (xmlHttp.overrideMimeType) {
                            xmlHttp.setRequestHeader(<span class="literal">"Connection"</span>, <span class="literal">"close"</span>);<span class="comment">//set header after open</span>
                        }			
                    }
                    catch(e) {
                        <span class="comment">// Do nothing</span>
                    }
                    xmlHttp.setRequestHeader(<span class="literal">"Content-Type"</span>, <span class="literal">"application/x-www-form-urlencoded"</span>); 
                    xmlHttp.send(queryString);
                }
            }
            catch(exception) {
                <span class="reserved">if</span>(errorHandler) {
                    errorHandler(self, exception);
                }
                <span class="reserved">else</span> {
                    throw exception;
                }
            }
            
            <span class="reserved">if</span>(!async) {  <span class="comment">//synchronous request, handle the state change</span>
                handleStateChange(self);
            }
            
            <span class="reserved">if</span>(self.isEchoDebugInfo()) {
                echoRequestParams();
            }
    }
    
    
    <span class="comment">/** <span class="attrib">@private</span> */</span>
    handleStateChange = <span class="reserved">function</span>(ajaxRequest) {
        <span class="reserved">if</span>(ajaxRequest.getXMLHttpRequestObject().readyState != 4) {
            <span class="reserved">return</span>;
        }
        <span class="reserved">if</span>(ajaxRequest.getXMLHttpRequestObject().status != 200) {
            errorHandler(self);
            <span class="reserved">return</span>;
        }
        try {
            var debug = ajaxRequest.isEchoDebugInfo();
            <span class="reserved">if</span>(debug) {
                echoResponse(ajaxRequest);
            }
            
            ajaxRequest.getParser().parse(ajaxRequest.getXMLHttpRequestObject().responseXML);
        }
        catch(exception) {
            <span class="reserved">if</span>(errorHandler) {
                errorHandler(self, exception);
            }
            <span class="reserved">else</span> {
                throw exception;
            }
        }
        finally {
            try {
                <span class="reserved">if</span>(ajaxRequest.getPostRequest()) {
                    var f = ajaxRequest.getPostRequest();
                    f(ajaxRequest);
                }
            }
            catch(exception) {
                <span class="reserved">if</span>(errorHandler) {
                    errorHandler(self, exception);
                }
            }
        }
    }
    
    
    <span class="comment">/**
     Create an instance of the XMLHttpRequest object, using the appropriate
     method for the type of browser in which this script is running. For Internet
     Explorer, it's an ActiveX object, for all others it's a native JavaScript
     object.
     <span class="attrib">@return</span> an instance of the XMLHttpRequest object.
     <span class="attrib">@private</span>
     */</span>
    <span class="reserved">function</span> createXMLHttpRequest() {
        var req = false;
        <span class="reserved">if</span> (window.XMLHttpRequest) {
            req = new XMLHttpRequest();
        }
        <span class="reserved">else</span> <span class="reserved">if</span> (window.ActiveXObject) {
            try {
                req = new ActiveXObject(<span class="literal">"Msxml2.XMLHTTP"</span>);
            }
            catch(e) {
                try {
                    req = new ActiveXObject(<span class="literal">"Microsoft.XMLHTTP"</span>);
                }
                catch(e) {
                    req = false;
                }
            }
        }
        <span class="reserved">return</span> req;
    }
    
    <span class="comment">/** <span class="attrib">@private</span> */</span>
    <span class="reserved">function</span> accumulateQueryString(newValues) {
        <span class="reserved">if</span>(queryString == <span class="literal">""</span>) {
            queryString = newValues; 
        }
        <span class="reserved">else</span> {
            queryString = queryString + <span class="literal">"&amp;"</span> +  newValues;
        }
    }
    
    <span class="comment">/** <span class="attrib">@private</span> */</span>
    <span class="reserved">function</span> toQueryString(elements) {
        var node = null;
        var qs = <span class="literal">""</span>;
        var name = <span class="literal">""</span>;
        
        var tempString = <span class="literal">""</span>;
        <span class="reserved">for</span>(var i = 0; i &lt; elements.length; i++) {
            tempString = <span class="literal">""</span>;
            node = elements[i];
            
            name = node.getAttribute(<span class="literal">"name"</span>);
            <span class="comment">//use id if name is null</span>
            <span class="reserved">if</span> (!name) {
                name = node.getAttribute(<span class="literal">"id"</span>);
            }
            name = encodeURIComponent(name);
            
            <span class="reserved">if</span>(node.tagName.toLowerCase() == <span class="literal">"input"</span>) {
                <span class="reserved">if</span>(node.type.toLowerCase() == <span class="literal">"radio"</span> || node.type.toLowerCase() == <span class="literal">"checkbox"</span>) {
                    <span class="reserved">if</span>(node.checked) {
                        tempString = name + <span class="literal">"="</span> + encodeURIComponent(node.value);
                    }
                }
                
                <span class="reserved">if</span>(node.type.toLowerCase() == <span class="literal">"text"</span> || node.type.toLowerCase() == <span class="literal">"hidden"</span> || node.type.toLowerCase() == <span class="literal">"password"</span>) {
                    tempString = name + <span class="literal">"="</span> + encodeURIComponent(node.value);
                }
            }
            <span class="reserved">else</span> <span class="reserved">if</span>(node.tagName.toLowerCase() == <span class="literal">"select"</span>) {
                tempString = getSelectedOptions(node);
            }
            
            <span class="reserved">else</span> <span class="reserved">if</span>(node.tagName.toLowerCase() == <span class="literal">"textarea"</span>) {
                tempString = name + <span class="literal">"="</span> + encodeURIComponent(node.value);
            }
            
            <span class="reserved">if</span>(tempString != <span class="literal">""</span>) {
                <span class="reserved">if</span>(qs == <span class="literal">""</span>) {
                    qs = tempString;
                }
                <span class="reserved">else</span> {
                    qs = qs + <span class="literal">"&amp;"</span> + tempString;
                }
            }
            
        }
        
        <span class="reserved">return</span> qs;
    }
    
    <span class="comment">/** <span class="attrib">@private</span> */</span>
    <span class="reserved">function</span> getSelectedOptions(select) {
        var options = select.options;
        var option = null;
        var qs = <span class="literal">""</span>;
        var tempString = <span class="literal">""</span>;
        
        <span class="reserved">for</span>(var x = 0; x &lt; options.length; x++) {
            tempString = <span class="literal">""</span>;
            option = options[x];
            
            <span class="reserved">if</span>(option.selected) {
                tempString = encodeURIComponent(select.name) + <span class="literal">"="</span> + encodeURIComponent(option.value);
            }
            
            <span class="reserved">if</span>(tempString != <span class="literal">""</span>) {
                <span class="reserved">if</span>(qs == <span class="literal">""</span>) {
                    qs = tempString;
                }
                <span class="reserved">else</span> {
                    qs = qs + <span class="literal">"&amp;"</span> + tempString;
                }
            }
        }
        
        <span class="reserved">return</span> qs;
    }
    
    <span class="comment">/** <span class="attrib">@private</span> */</span>
    <span class="reserved">function</span> echoResponse(ajaxRequest) {
        var echoTextArea = document.getElementById(<span class="literal">"debugResponse"</span>);
        <span class="reserved">if</span>(echoTextArea == null) {
            echoTextArea = createDebugTextArea(<span class="literal">"Server Response:"</span>, <span class="literal">"debugResponse"</span>);
        }
        var debugText = ajaxRequest.getXMLHttpRequestObject().status 
        + <span class="literal">" "</span> + ajaxRequest.getXMLHttpRequestObject().statusText + <span class="literal">"\n\n\n"</span>;
        echoTextArea.value = debugText + ajaxRequest.getXMLHttpRequestObject().responseText;
    }
    
    <span class="comment">/** <span class="attrib">@private</span> */</span>
    <span class="reserved">function</span> echoParsedJavaScript(js) {
        var echoTextArea = document.getElementById(<span class="literal">"debugParsedJavaScript"</span>);
        <span class="reserved">if</span>(echoTextArea == null) {
            var echoTextArea = createDebugTextArea(<span class="literal">"Parsed JavaScript (by JavaScript Parser):"</span>, <span class="literal">"debugParsedJavaScript"</span>);
        }
        echoTextArea.value = js;
    }
    
    <span class="comment">/** <span class="attrib">@private</span> */</span>
    <span class="reserved">function</span> createDebugTextArea(label, id) {
        echoTextArea = document.createElement(<span class="literal">"textarea"</span>);
        echoTextArea.setAttribute(<span class="literal">"id"</span>, id);
        echoTextArea.setAttribute(<span class="literal">"rows"</span>, <span class="literal">"15"</span>);
        echoTextArea.setAttribute(<span class="literal">"style"</span>, <span class="literal">"width:100%"</span>);
        echoTextArea.style.cssText = <span class="literal">"width:100%"</span>;
        
        document.getElementsByTagName(<span class="literal">"body"</span>)[0].appendChild(document.createTextNode(label));
        document.getElementsByTagName(<span class="literal">"body"</span>)[0].appendChild(echoTextArea);
        <span class="reserved">return</span> echoTextArea;
    }
    
    
    <span class="comment">/** <span class="attrib">@private</span> */</span>
    <span class="reserved">function</span> echoRequestParams() {
        var qsTextBox = document.getElementById(<span class="literal">"qsTextBox"</span>);
        <span class="reserved">if</span>(qsTextBox == null) {
            qsTextBox = createDebugTextBox(<span class="literal">"Query String:"</span>, <span class="literal">"qsTextBox"</span>);
        }
        qsTextBox.value = queryString;
        
        var urlTextBox = document.getElementById(<span class="literal">"urlTextBox"</span>);
        <span class="reserved">if</span>(urlTextBox == null) {
            urlTextBox = createDebugTextBox(<span class="literal">"URL (Includes query string if GET request):"</span>, <span class="literal">"urlTextBox"</span>);
        }
        urlTextBox.value = requestURL;
    }
    
    <span class="comment">/** <span class="attrib">@private</span> */</span>
    <span class="reserved">function</span> createDebugTextBox(label, id) {
        textBox = document.createElement(<span class="literal">"input"</span>);
        textBox.setAttribute(<span class="literal">"type"</span>, <span class="literal">"text"</span>);
        textBox.setAttribute(<span class="literal">"id"</span>, id);
        textBox.setAttribute(<span class="literal">"style"</span>, <span class="literal">"width:100%"</span>);
        textBox.style.cssText = <span class="literal">"width:100%"</span>;
        
        document.getElementsByTagName(<span class="literal">"body"</span>)[0].appendChild(document.createTextNode(label));
        document.getElementsByTagName(<span class="literal">"body"</span>)[0].appendChild(textBox);
        <span class="reserved">return</span> textBox;
    }
};
</pre>
	<hr>



<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> <font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top"><em>
<b></b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<font size="-1">

</font>
<div class="jsdoc_ctime">Documentation generated by <a href="http://jsdoc.sourceforge.net/" target="_parent">JSDoc</a> on Thu Jan 26 23:50:38 2012</div>
</body>
</html>
